# /usr/bin/env python
# Author: Gordon.Wang
# _*_ encoding: utf-8 _*_

#for循环实现从1加到100之间加法
# i = 0
# sum = 0
# for i in range(101):
#     sum += i
#     i+=1
# print(f"1-100累加的和是：{sum}")
#for循环实现从1到100之间的偶数相加
# i = 0
# sum = 0
# for i in range(101):
#     if i % 2 == 0:
#         sum += i
#     i+=1
# print(f"1-100累加的偶数和是：{sum}")
#while循环实现从1到100之间加法
# i = 0
# sum = 0
# while i <= 100:
#     sum += i
#     i += 1  #循环条件，i大于100就停止循环
# print(f"1-100累加的和是：{sum}")

#while循环实现从1到100之间的偶数相加
i = 0
sum = 0
while i <= 100:
    if i % 2 == 0:
        sum += i
    i += 1
print(f"1-100累加的偶数和是：{sum}")
